package com.technology.education.ui.common.withdraw_result

import android.widget.ImageView
import androidx.core.view.updateLayoutParams
import com.angcyo.dsladapter.dpi
import com.angcyo.dsladapter.dslItem
import com.technology.education.R
import com.technology.education.base.BaseRecyclerTopBarFragment
import com.technology.education.dslitem.ItemColumnTitleText
import com.technology.education.dslitem.ItemSingleButton
import com.technology.education.ext.getColor

/**
 *@author:create by BZY
 *Date: 2022/3/2 08
 * 兑换成功
 */
class WithdrawSuccessFragment:BaseRecyclerTopBarFragment<WithdrawSuccessViewModel>() {
    override fun initViews() {
        setTitle("兑换成功")
    }

    override fun lazyLoadData() {
      setUI()
    }

    private fun setUI() {
        renderAdapter {
            dslItem(R.layout.item_single_image){
                itemPaddingTop=24*dpi
                itemBindOverride={ itemHolder, _, _, _ ->
                    itemHolder.v<ImageView>(R.id.iv_image)?.apply {
                        updateLayoutParams {
                            width=166*dpi
                            height=155*dpi
                        }
                        setBackgroundColor(getColor(R.color.red))
                    }
                }
            }

            this+ItemColumnTitleText("订单号","222222").apply {
                style.topPadding=40
                style.lineHeight=0

            }+ItemColumnTitleText("支付时间","222222").apply {
                style.lineHeight=0
            }+ItemColumnTitleText("消耗积分","222222").apply {
                style.lineHeight=0
            }+ItemColumnTitleText("兑换时长","222222").apply {

            }+ItemSingleButton("确定").apply {
                style.titleTextColor=R.color.white
                style.titleTextSize=18f
                style.topPadding=24
                itemClick={
                    onBack()
                }
            }
        }
    }

    override fun createObserver() {

    }
}